First Order Equations: Integration Factors

Edmund Chiang
MATH2351 / 2352 — Boyce & DiPrima §2.1
February 6, 2026

1   Linear First Order DEs

We consider linear first order differential equations of the form:

Definition

A first order linear differential equation can be defined in the form $$\frac{dy}{dt} + P(t)\,y(t) = g(t)$$ where $P(t)$ and $g(t)$ are functions of $t$.

Example. The falling body problem $\;\dfrac{dv}{dt} = 9.8 - \dfrac{v}{5}\;$ can be written as

$$\frac{dv}{dt} + \frac{v}{5} = 9.8$$

which is in the above form with $P(t) = \dfrac{1}{5}$ and $g(t) = 9.8$ (both constants).

We illustrate the Integration Factor (IF) method by the following examples.


1.1   Example: Falling Body

Consider $\;\dfrac{dv}{dt} + \dfrac{v}{5} = 9.8.$

Multiply both sides by a function $\mu(t)$:

$$\mu(t)\frac{dv}{dt} + \mu(t)\frac{v}{5} = 9.8\,\mu(t). \tag{1}$$

We demand that the left side equals $\dfrac{d}{dt}\!\big[\mu(t)\,v(t)\big]$:

$$\big(\mu(t)\,y(t)\big)' = 9.8\,\mu(t). \tag{2}$$

Expanding the left side via the product rule (recall $(uv)' = u'v + uv'$):

$$\mu(t)\frac{dv}{dt} + \frac{d\mu(t)}{dt}\,v(t) = 9.8\,\mu(t). \tag{3}$$

Comparing equations (1) and (3):

Key Comparison $$\mu(t)\frac{dv}{dt} + \frac{d\mu(t)}{dt}\,v(t) = \mu(t)\frac{dv}{dt} + \mu(t)\frac{v(t)}{5}$$

This implies

$$\mu'(t) = \frac{1}{5}\,\mu(t)$$

must hold for the relevant $t$. Solving (by observation or separation of variables):

$$\mu(t) = Ae^{t/5}$$

for some $A \neq 0$. We may choose $A = 1$ since we can divide both sides of (3) by $A$. Substituting back into (2):

$$\big(e^{t/5}\,y(t)\big)' = 9.8\,e^{t/5}.$$

Integrating both sides:

$$e^{t/5}\,y(t) = \int 9.8\,e^{t/5}\,dt = 9.8 \times 5\,e^{t/5} + c.$$

Rearranging:

$$y(t) = 49 + c\,e^{-t/5}$$

which is the same expression obtained by separation of variables earlier (apart from the $|\cdot|$ sign issue, but the final solution with initial condition $v(0) = 0$ is the same for both methods).


1.2   Example: Exponential RHS

Solve $\;\dfrac{dy}{dt} + \dfrac{1}{2}\,y = \dfrac{1}{2}\,e^{t/3}.$

Multiply both sides by $\mu(t)$:

$$\mu(t)\frac{dy}{dt} + \mu(t)\frac{1}{2}\,y = \mu(t)\frac{1}{2}\,e^{t/3}$$

and demand the left side equals $\dfrac{d}{dt}\!\big[\mu(t)\,y(t)\big]$. Comparing via the product rule:

Key Comparison $$\mu(t)\frac{dy}{dt} + \frac{d\mu(t)}{dt}\,y(t) = \mu(t)\frac{dy}{dt} + \mu(t)\frac{1}{2}\,y(t)$$

So we need $\;\dfrac{d\mu(t)}{dt} = \dfrac{1}{2}\,\mu(t).$ Solving:

$$\frac{t}{2} + c = \int \frac{1}{2}\,dt = \int \frac{\mu'}{\mu}\,dt = \ln|\mu(t)|.$$

Thus $\mu(t) = Ce^{t/2}$. Choosing $C=1$:

$$\frac{d}{dt}\big(e^{t/2}\,y\big) = \frac{1}{2}\,e^{t/2}\cdot e^{t/3} = \frac{1}{2}\,e^{5t/6}.$$

Integrating:

$$e^{t/2}\,y = \int \frac{1}{2}\,e^{5t/6}\,dt = \frac{3}{5}\,e^{5t/6} + c.$$

Hence

$$y(t) = \frac{3}{5}\,e^{t/3} + c\,e^{-t/2}.$$

1.3   Example: Linear with Polynomial RHS

Solve $\;\dfrac{dy}{dt} - 2y = 4 - t.$

Multiplying by $\mu$ and comparing via the product rule gives $\mu' = -2\mu$, i.e.

$$\frac{\mu'}{\mu} = -2 \implies \ln|\mu| = -2t + c \implies \mu = Ce^{-2t}.$$

Choosing $C = 1$:

$$\frac{d}{dt}\big(e^{-2t}\,y\big) = e^{-2t}(4-t).$$

Integrating (using integration by parts for $\int te^{-2t}\,dt$):

$$e^{-2t}\,y(t) = \int e^{-2t}(4-t)\,dt = \int 4e^{-2t}\,dt - \int te^{-2t}\,dt.$$

Computing each integral:

$$\int 4e^{-2t}\,dt = -2e^{-2t}$$

For $\int te^{-2t}\,dt$, let $u = t$, $dv = e^{-2t}\,dt$, so $du = dt$, $v = -\tfrac{1}{2}e^{-2t}$:

$$\int te^{-2t}\,dt = -\frac{1}{2}te^{-2t} - \int -\frac{1}{2}e^{-2t}\,dt = -\frac{1}{2}te^{-2t} - \frac{1}{4}e^{-2t}.$$

Combining:

$$e^{-2t}\,y = -2e^{-2t} - \Big(-\frac{1}{2}te^{-2t} - \frac{1}{4}e^{-2t}\Big) + k = -\frac{7}{4}e^{-2t} + \frac{1}{2}te^{-2t} + k.$$

Thus

$$y(t) = -\frac{7}{4} + \frac{t}{2} + k\,e^{2t}.$$

2   General Integration Factor Formula

For the general equation $\;\dfrac{dy}{dt} + P(t)\,y = g(t)$, multiply by $\mu(t)$:

$$\mu(t)\frac{dy}{dt} + \mu(t)P(t)\,y(t) = \mu(t)\,g(t).$$

We demand that $\mu(t)\,P(t) = \mu'(t)$, i.e.

$$\frac{\mu'(t)}{\mu(t)} = P(t).$$

Integrating:

$$\ln|\mu(t)| = \int P\,dt + c, \qquad |\mu(t)| = e^c \cdot e^{\int P\,dt}.$$

Hence $\mu(t) = Ce^{\int P\,dt}$. Choosing $C = 1$:

$$\frac{d}{dt}\!\Big(e^{\int P\,dt}\,y(t)\Big) = e^{\int P\,dt}\,g(t).$$
Theorem — Integration Factor Formula

A solution of $\;\dfrac{dy}{dt} + P(t)\,y = g(t)\;$ can be written as $$\boxed{\;y(t) = e^{-\int P\,dt}\!\left(\int e^{\int P\,dt}\,g(t)\,dt + c\right).\;}$$ This is called the Integration Factor formula.


2.1   Example (revisited): $y' + \tfrac{1}{2}y = \tfrac{1}{2}e^{t/3}$

Using the formula directly: $P(t) = \tfrac{1}{2}$, so

$$\mu(t) = e^{\int \frac{1}{2}\,dt} = e^{t/2}.$$

Hence

$$y(t) = e^{-t/2}\!\left(\int e^{t/2}\cdot\frac{1}{2}\,e^{t/3}\,dt + c\right) = \frac{3}{5}\,e^{t/3} + c\,e^{-t/2},$$

as expected.


2.2   Example (revisited): $y' - 2y = 4 - t$

We immediately have $\;\mu(t) = e^{\int P\,dt} = e^{\int -2\,dt} = e^{-2t}.$ Hence

$$y(t) = e^{2t}\!\left(\int e^{-2t}(4-t)\,dt + c\right) = -\frac{7}{4} + \frac{t}{2} + k\,e^{2t}.$$

2.3   Example IVP: $y' + \tfrac{2}{t}\,y = 4t$, $\;y(1)=2$

Here $P(t) = 2/t$, so

$$\mu(t) = e^{\int 2/t\,dt} = e^{2\ln t} = t^2.$$

The IF formula gives

$$y(t) = t^{-2}\!\left(\int t^2 \cdot 4t\,dt + c\right) = t^{-2}\!\left(t^4 + c\right) = t^2 + \frac{c}{t^2}.$$

Applying $y(1) = 2$:

$$2 = y(1) = 1^2 + \frac{c}{1^2} = 1 + c \implies c = 1.$$
$$y(t) = t^2 + \frac{1}{t^2}.$$
Remark

The direction field plot for this DE shows that at $x = 0$ the field becomes "vertical" — i.e. $y'$ is infinite or undefined. This is because the differential equation is undefined when $x = 0$.


2.4   Example IVP: $2y' + ty = 2$, $\;y(0) = 1$

Rewrite as $\;y' + \dfrac{t}{2}\,y = 1.$ Here $P(t) = t/2$, so

$$\mu(t) = e^{\int t/2\,dt} = e^{t^2/4}.$$

The IF formula gives

$$y(x) = e^{-t^2/4}\!\left(\int_0^t e^{s^2/4}\cdot 1\,ds + c\right) = e^{-t^2/4}\int_0^t e^{s^2/4}\,ds + c\,e^{-t^2/4}$$

since we do not know how to find the primitive of $\int e^{t^2/4}\,dt$ in closed form (it is a function of $t$). Applying the initial condition $y(0) = 1$:

$$1 = y(0) = 0 + c \implies c = 1.$$
$$y(t) = e^{-t^2/4}\int_0^t e^{s^2/4}\,ds + e^{-t^2/4}.$$

Exercise

Solve and draw the direction field of

$$ty' + 2y = \sin t \quad (t > 0).$$

Investigate what happens when $t \to \infty$.

3   Exercises

Exercises — Integration Factor Method

Solve the following first order DEs:

  1. $y' + 2xy = 4x$ (Ans. $y = 2 + Ce^{-x^2}$)
  2. $xy' = y + x^3 + 3x^2 - 2x$ (Ans. $2y = x^3 + 6x^2 - 4x\ln x + Cx$)
  3. $(x-2)y' = y + 2(x-2)^3$ (Ans. $y = C(x-2) + x(x-2)(x-4)$)
  4. $y' + y\cot x = 5e^{\cos x}$ (Ans. $y\sin x + 5e^{\cos x} = 1$)
  5. $y' - y = xy^5$ (Bernoulli's equation) (Ans. $y^{-4} = -x + \frac{1}{4} + Ce^{-4x}$)

4   Practice MCQ

Practice 1: Solve a Linear First Order DE (Three-Phase)

Solve the differential equation:

$$\frac{dy}{dt} + 3y = 6t$$
PHASE 0 Classify the DE

What method should we use to solve this DE?

Correct! This is a linear first-order DE. Now let's plan the strategy...
PHASE A Build the Strategy

What's the first step?

What's the next step?

After finding $\mu(t)$, what's next?

Now we have $\frac{d}{dt}(\mu y) = \mu g$. What's next?

Strategy complete! Now let's compute...
PHASE B Execute the Computation
Step B1

What is the integrating factor $\mu(t) = e^{\int P\,dt} = e^{\int 3\,dt}$?

Step B2

After multiplying by $\mu = e^{3t}$, the left side becomes $\dfrac{d}{dt}(e^{3t}y)$. What integral do we evaluate on the right?

Step B3

Evaluate $\int 6te^{3t}\,dt$ by parts. Let $u = 6t$, $dv = e^{3t}\,dt$. Then $du = 6\,dt$, $v = \frac{1}{3}e^{3t}$. The integral is:

Step B4

We have $e^{3t}y = 2te^{3t} - \frac{2}{3}e^{3t} + c$. Solving for $y$:

All phases complete — excellent work! The solution is $y = 2t - \frac{2}{3} + ce^{-3t}$.
Practice 2: Solve an IVP with Variable Coefficient (Three-Phase)

Solve the initial value problem:

$$y' + \frac{2}{t}\,y = 4t, \quad y(1) = 2$$
PHASE 0 Classify the DE

What method should we use?

Correct! Let's plan the approach...
PHASE A Build the Strategy

First step?

After finding $\mu(t) = t^2$, what's next?

After integrating $\frac{d}{dt}(t^2 y) = 4t^3$ to get the general solution, what's the final step?

Strategy set! Now let's compute...
PHASE B Execute
Step B1

$\mu(t) = e^{\int 2/t\,dt} = e^{2\ln t} = \;?$

Step B2

Multiply: $t^2 y' + 2ty = 4t^3$. The left side is $\frac{d}{dt}(t^2 y)$. Integrating: $t^2 y = \int 4t^3\,dt = \;?$

Step B3

So $t^2 y = t^4 + c$, hence $y = t^2 + \frac{c}{t^2}$. Apply $y(1) = 2$:

Step B4

The particular solution is:

Excellent! The solution to the IVP is $y = t^2 + \frac{1}{t^2}$.
Practice 3: Identify Integrating Factors

For each DE, identify the correct integrating factor $\mu(t)$.

Problem A

$\;y' + \dfrac{1}{t}\,y = t^2$. What is $\mu(t)$?

Problem B

$\;y' - \dfrac{2}{t}\,y = t^3$. What is $\mu(t)$?

Problem C

$\;y' + (\cos t)\,y = \sin t$. What is $\mu(t)$?

Problem D

$\;2y' + ty = 2$ (rewrite as $y' + \tfrac{t}{2}y = 1$). What is $\mu(t)$?

All integrating factors identified correctly!
Practice 4: Linear DE with Polynomial RHS (Three-Phase)

Solve the differential equation (from lecture):

$$\frac{dy}{dt} - 2y = 4 - t$$
PHASE 0 Classify the DE

What method should we use?

Correct! Now let's plan...
PHASE A Build the Strategy

First, identify $P(t)$ and compute $\mu(t)$:

After multiplying by $\mu = e^{-2t}$, we'll need to integrate $\int e^{-2t}(4-t)\,dt$. What technique is needed?

For $\int te^{-2t}\,dt$ by parts, what should we choose for $u$ and $dv$?

Strategy complete! Let's compute...
PHASE B Execute
Step B1

$\displaystyle\int 4e^{-2t}\,dt = \;?$

Step B2

For $\int te^{-2t}\,dt$: let $u = t$, $dv = e^{-2t}\,dt$, so $du = dt$, $v = -\frac{1}{2}e^{-2t}$. By IBP:

Step B3

$e^{-2t}y = \int e^{-2t}(4-t)\,dt = -2e^{-2t} - (-\frac{1}{2}te^{-2t} - \frac{1}{4}e^{-2t}) + k$. Simplify:

Step B4

Dividing by $e^{-2t}$ (i.e., multiplying by $e^{2t}$):

Excellent! The solution is $y = -\frac{7}{4} + \frac{t}{2} + ke^{2t}$.

— End of Integration Factors Notes —